<html><head><meta http-equiv="content-type" content="text/html; charset=utf8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * Events that the event bus carries.
<span class='line'>  3</span>  * 
<span class='line'>  4</span>  * @namespace
<span class='line'>  5</span>  */</span><span class="WHIT">
<span class='line'>  6</span> </span><span class="NAME">mindmaps.Event</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>  8</span> 	 * @event
<span class='line'>  9</span> 	 * @param {mindmaps.Document} document
<span class='line'> 10</span> 	 */</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">	</span><span class="NAME">DOCUMENT_OPENED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"DocumentOpenedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 12</span> 
<span class='line'> 13</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 14</span> 	 * @event
<span class='line'> 15</span> 	 * @param {mindmaps.Document} document
<span class='line'> 16</span> 	 */</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">	</span><span class="NAME">DOCUMENT_SAVED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"DocumentSavedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 18</span> 
<span class='line'> 19</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 20</span> 	 * @event
<span class='line'> 21</span> 	 * @param {mindmaps.Document} document
<span class='line'> 22</span> 	 */</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">	</span><span class="NAME">DOCUMENT_CLOSED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"DocumentClosedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 24</span> 
<span class='line'> 25</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 26</span> 	 * @event
<span class='line'> 27</span> 	 * @param {mindmaps.Node} node
<span class='line'> 28</span> 	 * @param {mindmaps.Node} oldSelectedNode
<span class='line'> 29</span> 	 */</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">	</span><span class="NAME">NODE_SELECTED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeSelectedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 31</span> 
<span class='line'> 32</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 33</span> 	 * @event
<span class='line'> 34</span> 	 * @param {mindmaps.Node} node
<span class='line'> 35</span> 	 */</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">	</span><span class="NAME">NODE_DESELECTED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeDeselectedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 37</span> 
<span class='line'> 38</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 39</span> 	 * @event
<span class='line'> 40</span> 	 * @param {mindmaps.Node} node
<span class='line'> 41</span> 	 */</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">	</span><span class="NAME">NODE_MOVED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeMovedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 43</span> 
<span class='line'> 44</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 45</span> 	 * @event
<span class='line'> 46</span> 	 * @param {mindmaps.Node} node
<span class='line'> 47</span> 	 */</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">	</span><span class="NAME">NODE_TEXT_CAPTION_CHANGED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeTextCaptionChangedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 49</span> 
<span class='line'> 50</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 51</span> 	 * Some parameter of the node font attribute has changed.
<span class='line'> 52</span> 	 * 
<span class='line'> 53</span> 	 * @event
<span class='line'> 54</span> 	 * @param {mindmaps.Node} node
<span class='line'> 55</span> 	 */</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">	</span><span class="NAME">NODE_FONT_CHANGED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeFontChangedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 57</span> 
<span class='line'> 58</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 59</span> 	 * @event
<span class='line'> 60</span> 	 * @param {mindmaps.Node} node
<span class='line'> 61</span> 	 */</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">	</span><span class="NAME">NODE_BRANCH_COLOR_CHANGED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeBranchColorChangedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 63</span> 
<span class='line'> 64</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 65</span> 	 * @event
<span class='line'> 66</span> 	 * @param {mindmaps.Node} node
<span class='line'> 67</span> 	 */</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">	</span><span class="NAME">NODE_CREATED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeCreatedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 69</span> 
<span class='line'> 70</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 71</span> 	 * @event
<span class='line'> 72</span> 	 * @param {mindmaps.Node} node
<span class='line'> 73</span> 	 * @param {mindmaps.Node} parent
<span class='line'> 74</span> 	 */</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">	</span><span class="NAME">NODE_DELETED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeDeletedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 76</span> 
<span class='line'> 77</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 78</span> 	 * @event
<span class='line'> 79</span> 	 * @param {mindmaps.Node} node
<span class='line'> 80</span> 	 */</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">	</span><span class="NAME">NODE_OPENED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeOpenedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 82</span> 
<span class='line'> 83</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 84</span> 	 * @event
<span class='line'> 85</span> 	 * @param {mindmaps.Node} node
<span class='line'> 86</span> 	 */</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">	</span><span class="NAME">NODE_CLOSED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NodeClosedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 88</span> 
<span class='line'> 89</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 90</span> 	 * @event
<span class='line'> 91</span> 	 * @param {Number} zoomFactor
<span class='line'> 92</span> 	 */</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">	</span><span class="NAME">ZOOM_CHANGED</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ZoomChangedEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 96</span> 	 * @event
<span class='line'> 97</span> 	 * @param {String} message
<span class='line'> 98</span> 	 */</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">	</span><span class="NAME">NOTIFICATION_INFO</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NotificationInfoEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>102</span> 	 * @event
<span class='line'>103</span> 	 * @param {String} message
<span class='line'>104</span> 	 */</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">	</span><span class="NAME">NOTIFICATION_WARN</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NotificationWarnEvent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>108</span> 	 * @event
<span class='line'>109</span> 	 * @param {String} message
<span class='line'>110</span> 	 */</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">	</span><span class="NAME">NOTIFICATION_ERROR</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"NotificationErrorEvent"</span><span class="WHIT">
<span class='line'>112</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> 
<span class='line'>114</span> </span><span class="COMM">/**
<span class='line'>115</span>  * Simple Event bus powered by EventEmitter.
<span class='line'>116</span>  * 
<span class='line'>117</span>  * @constructor
<span class='line'>118</span>  * @augments EventEmitter
<span class='line'>119</span>  * 
<span class='line'>120</span>  */</span><span class="WHIT">
<span class='line'>121</span> </span><span class="NAME">mindmaps.EventBus</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">EventEmitter</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>122</span> 
<span class='line'>123</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">mindmaps.DEBUG</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT">	</span><span class="COMM">// overwrite publish func and display amount of listeners</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">old</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mindmaps.EventBus.prototype.emit</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">	</span><span class="NAME">mindmaps.EventBus.prototype.publish</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.listeners</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">		</span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"EventBus > publish: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"(Listeners: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">")"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> 
<span class='line'>130</span> </span><span class="WHIT">		</span><span class="NAME">old.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="PUNC">}</span></pre></body></html>